package com.seagull.core.test.desing.xiangyuan;

/**
 * @author:jian.zhou
 * @DATE: 2017/12/27.
 * @Version:0.0.1
 * @Desc:
 */
public class ConcreteFlyweight implements Flyweight {

    private Character intrinsicState = null;


    public ConcreteFlyweight( Character intrinsicState) {
            this.intrinsicState = intrinsicState;
    }

    /**
     * 外蕴状态作为参数传入方法中，改变方法的行为
     * 但是并不改变方法的内蕴状态
     */
    @Override
    public void operation(String state) {
        System.out.println("Intrinsic State = " + this.intrinsicState);
        System.out.println("Extrinsic State = " + state);
    }
}
